

#ifndef MAIN_H
#define MAIN_H


#include <X11/Xlib.h>
#include <X11/Xutil.h>

#include "Circle.h"
#include "Line.h"
//#include "Polygon.h"
#include "Polyline.h"
//#include "Triangle.h"
//#include "Color.h"

#endif
#include<stdlib.h>


class Man{

public:
    MyDisplay *show;
  
    Circle *face;
  //Polyline legs("legs.txt",show);
    Polyline *hands;
    Line *leg,*body;
    
    int step;
  
     Man();
     ~Man();
     
     
     bool stepAction1();
     bool stepAction2();
     
     bool walk(int step);
     
  };


int main(){

   Man xyz;
  
   
   
   for(int i = 0;i<100;i=i+2){
   
   
     xyz.stepAction1();
     
    XClearWindow(xyz.show->display,xyz.show->win);
    
    xyz.step = xyz.step + 2;
    
    xyz.stepAction2();
    
    //sleep(1);
    }

 
    sleep(10);
  
  return 1;    

}




  
  
  
  
  Man::Man(){
  
      show = new MyDisplay;
      
      hands = new Polyline("hands.txt",(*show));
      
      leg = new Line((*show));
      
      body = new Line((*show));
      
      face = new Circle(20,(*show));
      
      step = 0;
  }
   
  
  Man::~Man(){
  
  }
  
  bool Man::stepAction1(){
  
    face->draw(0 + step ,0);
    body->drawLine(0+ step ,-25,0+ step,-125); 
  
    hands->change(2);
    hands->draw();
    
   leg->drawLine(-20+ step ,-225,0+ step,-125);
    
    leg->drawLine(0+ step,-125,20+ step ,-225);
    
      
  }
  
  
  bool Man::stepAction2(){
  
  
    face->draw(0+ step ,0);
    body->drawLine(0 + step,-25,0+ step,-125); 
  
    hands->change(0);
    hands->draw();
    
    leg->drawLine(-10+ step ,-225,0+ step,-125);
    
    leg->drawLine(0+ step,-125,20 + step,-175);
    
    leg->drawLine(20+ step ,-175,30+ step,-220);
    

  }
  
  
  bool Man::walk(int steps){
  
  
  
  
   
  
  }
  